package com.azunitech.jms;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import org.junit.Before;
import org.junit.Test;

import com.azunitech.jms.common.IPartRepository;
import com.azunitech.jms.common.domains.LocationVo;
import com.azunitech.jms.common.domains.PartsEntity;
import com.azunitech.jms.repos.Location;
import com.azunitech.jms.repos.PartsRepository;

public class PartsRepositoryTester {
	private IPartRepository m_PartsRepository;
	
	@Before public void init(){
		this.m_PartsRepository = new PartsRepository();
		this.m_PartsRepository.init();
    }
	
	@Test public void createParts_with_partNumber(){
		PartsEntity entity = this.m_PartsRepository.getParts("12455");
		System.out.println(entity);
	}
	
	@Test public void createParts_with_partNumber_and_locations(){
		Collection<LocationVo> locations = new ArrayList<LocationVo>();
		LocationVo vo = new LocationVo("a-v-d");
		vo.increaseQuantity(100);
		locations.add( vo);
		PartsEntity entity = this.m_PartsRepository.getParts("12455", locations);
		System.out.println(entity);
	}
}
